package com.litxuf.web.upload.forms;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.action.ActionForm;

import com.litxuf.web.upload.UploadFile;

public class MultiUploadForm extends ActionForm {

	private String id; 

	private String title; 

	private String subTitle; 

	private String content; 

	private String modelId; 

	private List myFiles; 


	public List getMyFiles() { 
	   return myFiles; 
	} 

	public void setMyFiles(List myFiles) { 
	   this.myFiles = myFiles; 
	} 

	public MultiUploadForm() { 
	   myFiles = new ArrayList(); 
	} 

//	 注意这个方法的定义 不加中间的循环是会出错的 

	public UploadFile getUploadFile(int index) { 
		System.out.println("sss-=--");
	   int size = myFiles.size(); 
	   if (index > size - 1) { 
	    for (int i = 0; i < index - size + 1; i++) { 
	     myFiles.add(new UploadFile()); 
	    } 
	   } 
	   return (UploadFile) myFiles.get(index); 
	} 



	public String getModelId() { 
	   return modelId; 
	} 

	public void setModelId(String modelId) { 
	   this.modelId = modelId; 
	} 


	public String getId() { 
	   return id; 
	} 

	public void setId(String id) { 
	   this.id = id; 
	} 

	public String getTitle() { 
	   return title; 
	} 

	public void setTitle(String title) { 
	   this.title = title; 
	} 

	public String getSubTitle() { 
	   return subTitle; 
	} 

	public void setSubTitle(String subTitle) { 
	   this.subTitle = subTitle; 
	} 

	public String getContent() { 
	   return content; 
	} 

	public void setContent(String content) { 
	   this.content = content; 
	} 


}